<template>
	<div class="max">
		<my-header :backBtn="true">
			<div slot="title">
				请假详情
			</div>
		</my-header>
		<div class="cont-nof">
			<div class="weui-form-preview">
				<div class="weui-form-preview__hd">
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">请假人</label>
						<em class="weui-form-preview__value">{{data.teacherName}}</em>
					</div>
				</div>
				<div class="weui-form-preview__bd">
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">请假开始时间</label>
						<span class="weui-form-preview__value">{{data.startTime}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">请假结束时间</label>
						<span class="weui-form-preview__value">{{data.endTime}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">请假类型</label>
						<span class="weui-form-preview__value">{{data.leaveType}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">请假理由</label>
						<span class="weui-form-preview__value">{{data.reason}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">审批结果</label>
						<span class="weui-form-preview__value weui-badge fr" v-if="data.status==0" style="background: orange;">待审批</span>
						<span class="weui-form-preview__value weui-badge fr" v-if="data.status==1" style="background: #06AD56;">已同意</span>
						<span class="weui-form-preview__value weui-badge fr" v-if="data.status==2">不同意</span>

					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">审批人</label>
						<span class="weui-form-preview__value">{{data.judePerson}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">审批意见</label>
						<span class="weui-form-preview__value">{{data.judeContent}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">审批时间</label>
						<span class="weui-form-preview__value">{{data.judeTime}}</span>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
			}
		},
		methods: {
			back() {
				if (!!this.$Cookies.get('from')) {
					this.$router.push('/askForLeaveList');
				} else {
					wx.closeWindow();
				}
			},
			jude(val) {
				this.data.status = val;
				//提交结果
			}
		},
		created() {
			this.data = this.$route.query;
		},

	}
</script>

<style scoped>
	.details-title {
		font-size: 1.8rem;
		width: 100%;
		padding: 0.5rem 0;
		background: #F7F7F7;
	}
</style>
